cc.Class({
    extends: cc.Component,

    properties: {
        operlist: [cc.SpriteFrame], // chi peng gang
        spr1: cc.Sprite,
        spr2: cc.Sprite,
        _act: 0,
        act:{
            get(){return this._act;},
            set(n) {
                this._act = n; 
                this.spr1.spriteFrame = this.operlist[this._act];
                this.spr2.spriteFrame = this.operlist[this._act];
            },
        },
    },

    play(n){
        if(n != null){
            this.act = n;
        }
        this.node.zIndex = (9999);
        /* let act = this.node.getComponent(cc.Animation);
        act.play(); */
		this.node.active = true;
		this.node.setScale(0.1);
		this.node.runAction(cc.sequence(
			cc.scaleTo(0.2, 1.2),
			cc.scaleTo(0.02, 1),
			cc.delayTime(0.8),
			cc.callFunc(() => {
				this.node.active = false;
			})
		));
    },
});
